/*
 * Code generated for Simulink model VCUComposition_demo.
 *
 * FILE    : VCUComposition_demo.h
 *
 * VERSION : 1.86
 *
 * DATE    : Sun Sep  8 01:03:14 2024
 *
 * Copyright 2011-2017 ECUCoder. All Rights Reserved.
 */

#ifndef RTW_HEADER_VCUComposition_demo_h_
#define RTW_HEADER_VCUComposition_demo_h_
#include <math.h>
#include "MPC5744P.h"
#include "Std_Types.h"
#include "can.h"
#include "flash.h"
#include "crc.h"
#ifndef VCUComposition_demo_COMMON_INCLUDES_
#define VCUComposition_demo_COMMON_INCLUDES_
#include "rtwtypes.h"
#endif                                /* VCUComposition_demo_COMMON_INCLUDES_ */

#include "VCUComposition_demo_types.h"

/* Macros for accessing real-time model data structure */
#ifndef rtmStepTask
#define rtmStepTask(rtm, idx)          ((rtm)->Timing.TaskCounters.TID[(idx)] == 0)
#endif

#ifndef rtmTaskCounter
#define rtmTaskCounter(rtm, idx)       ((rtm)->Timing.TaskCounters.TID[(idx)])
#endif

#define EnableInterrupts()             asm(" wrteei 1")
#define DisableInterrupts()            asm(" wrteei 0")

/* Block signals (default storage) */
typedef struct {
  uint32_T CANReceive_o3;              /* '<S29>/CANReceive' */
  uint32_T CANReceive_o3_c;            /* '<S15>/CANReceive' */
  uint8_T CANReceive_o2;               /* '<S29>/CANReceive' */
  uint8_T CANReceive_o4[8];            /* '<S29>/CANReceive' */
  uint8_T CANReceive_o5;               /* '<S29>/CANReceive' */
  uint8_T CANReceive_o2_p;             /* '<S15>/CANReceive' */
  uint8_T CANReceive_o4_j[8];          /* '<S15>/CANReceive' */
  uint8_T CANReceive_o5_k;             /* '<S15>/CANReceive' */
  uint8_T CANTransmit;                 /* '<S22>/CANTransmit' */
  boolean_T Switch;                    /* '<S41>/Switch' */
} B_VCUComposition_demo_T;

/* Block states (default storage) for system '<Root>' */
typedef struct {
  real_T UnitDelay_DSTATE[2];          /* '<S34>/Unit Delay' */
  uint32_T previousTicks;              /* '<S1>/Chart' */
  struct {
    uint_T is_c3_VCUComposition_demo:4;/* '<S1>/Chart' */
    uint_T is_active_c1_VCUComposition_dem:1;/* '<S1>/GearFSM' */
    uint_T is_active_c3_VCUComposition_dem:1;/* '<S1>/Chart' */
  } bitsForTID5;

  uint16_T RateTransition5_Buffer;     /* '<Root>/Rate Transition5' */
  uint16_T RateTransition6_Buffer;     /* '<Root>/Rate Transition6' */
  boolean_T UnitDelay1_DSTATE[2];      /* '<S34>/Unit Delay1' */
  uint8_T temporalCounter_i1;          /* '<S1>/Chart' */
  boolean_T RateTransition3_Buffer;    /* '<Root>/Rate Transition3' */
} DW_VCUComposition_demo_T;

/* Real-time Model Data Structure */
struct tag_RTM_VCUComposition_demo_T {
  /*
   * Timing:
   * The following substructure contains information regarding
   * the timing information for the model.
   */
  struct {
    uint32_T clockTick5;
    struct {
      uint16_T TID[8];
    } TaskCounters;

    struct {
      boolean_T TID1_2;
      boolean_T TID2_4;
    } RateInteraction;
  } Timing;
};

/* Block signals (default storage) */
extern B_VCUComposition_demo_T VCUComposition_demo_B;

/* Block states (default storage) */
extern DW_VCUComposition_demo_T VCUComposition_demo_DW;

/*
 * Exported Global Signals
 *
 * Note: Exported global signals are block signals with an exported global
 * storage class designation.  Code generation will declare the memory for
 * these signals and export their symbols.
 *
 */
extern real32_T APPS_PctAccPedlRaw;    /* '<S32>/Data Type Conversion' */
extern GearFSMActType SatCov_stGearFSMActvSt;/* '<S1>/GearFSM' */
extern uint16_T VCUInHW_uAPP1;         /* '<S5>/AnalogInput' */
extern uint16_T VCUInHW_uAPP2;         /* '<S5>/AnalogInput1' */
extern uint16_T VCUInHW_uBkP;          /* '<S5>/AnalogInput2' */
extern boolean_T VCUInHW_b99MRLS0A4st; /* '<S5>/PowerDriverState1' */

/*
 * Exported Global Parameters
 *
 * Note: Exported global parameters are tunable parameters with an exported
 * global storage class designation.  Code generation will declare the memory for
 * these parameters and exports their symbols.
 *
 */
extern real32_T Cal_APPS_PctAccrPedlRaw_Pctg_v[2];
                                     /* Variable: Cal_APPS_PctAccrPedlRaw_Pctg_v
                                      * Referenced by:
                                      *   '<S32>/1-D Lookup Table'
                                      *   '<S32>/1-D Lookup Table2'
                                      */
extern real32_T Cal_APPS_PctAccrPedlRaw_mv_x[2];/* Variable: Cal_APPS_PctAccrPedlRaw_mv_x
                                                 * Referenced by:
                                                 *   '<S32>/1-D Lookup Table'
                                                 *   '<S32>/1-D Lookup Table2'
                                                 */
extern uint16_T Cal_APPS_uAPPmvHWmax_K;/* Variable: Cal_APPS_uAPPmvHWmax_K
                                        * Referenced by: '<S31>/Constant'
                                        */
extern uint16_T Cal_APPS_uAPPmvHWmin_K;/* Variable: Cal_APPS_uAPPmvHWmin_K
                                        * Referenced by:
                                        *   '<S31>/Constant1'
                                        *   '<S32>/Constant'
                                        */
extern boolean_T Cal_VCUOutHw_bMstRlyEn_RepFlg;
                                      /* Variable: Cal_VCUOutHw_bMstRlyEn_RepFlg
                                       * Referenced by: '<S6>/Constant1'
                                       */
extern boolean_T Cal_VCUOutHw_bMstRlyEn_RepVal;
                                      /* Variable: Cal_VCUOutHw_bMstRlyEn_RepVal
                                       * Referenced by: '<S6>/Constant3'
                                       */

/* External function called from main */
extern void VCUComposition_demo_SetEventsForThisBaseStep(boolean_T *eventFlags);

/* Model entry point functions */
extern void VCUComposition_demo_SetEventsForThisBaseStep(boolean_T *eventFlags);
extern void VCUComposition_demo_initialize(void);
extern void VCUComposition_demo_step0(void);
extern void VCUComposition_demo_step1(void);
extern void VCUComposition_demo_step2(void);
extern void VCUComposition_demo_step3(void);
extern void VCUComposition_demo_step4(void);
extern void VCUComposition_demo_step5(void);
extern void VCUComposition_demo_step6(void);
extern void VCUComposition_demo_step7(void);
extern void VCUComposition_demo_step(int_T tid);
extern uint8_T ECUCoderModelBaseCounter;
extern uint32_t IntcIsrVectorTable[];
extern uint8_T AfterRunFlags[2];
extern SSD_CONFIG ssdConfig;
extern void ISR_PIT_CH3(void);

/* Real-time Model object */
extern RT_MODEL_VCUComposition_demo_T *const VCUComposition_demo_M;

/*-
 * These blocks were eliminated from the model due to optimizations:
 *
 * Block '<S1>/ConstNum' : Unused code path elimination
 * Block '<S1>/ConstNum1' : Unused code path elimination
 * Block '<S1>/ConstNum2' : Unused code path elimination
 * Block '<S8>/AND' : Unused code path elimination
 * Block '<S8>/NOT' : Unused code path elimination
 * Block '<S8>/Unit Delay' : Unused code path elimination
 * Block '<S1>/Equal' : Unused code path elimination
 * Block '<S10>/AND' : Unused code path elimination
 * Block '<S10>/Add' : Unused code path elimination
 * Block '<S10>/Constant' : Unused code path elimination
 * Block '<S10>/Constant1' : Unused code path elimination
 * Block '<S10>/Constant2' : Unused code path elimination
 * Block '<S10>/NOT' : Unused code path elimination
 * Block '<S10>/NOT1' : Unused code path elimination
 * Block '<S10>/Relational Operator' : Unused code path elimination
 * Block '<S10>/Switch' : Unused code path elimination
 * Block '<S10>/Switch1' : Unused code path elimination
 * Block '<S10>/Switch2' : Unused code path elimination
 * Block '<S10>/Switch3' : Unused code path elimination
 * Block '<S10>/Unit Delay' : Unused code path elimination
 * Block '<S10>/Unit Delay1' : Unused code path elimination
 * Block '<S10>/Unit Delay2' : Unused code path elimination
 * Block '<S2>/Constant' : Unused code path elimination
 * Block '<Root>/Rate Transition1' : Unused code path elimination
 * Block '<S33>/FixPt Data Type Duplicate' : Unused code path elimination
 * Block '<S34>/Data Type Duplicate' : Unused code path elimination
 * Block '<S36>/ConstFalse' : Unused code path elimination
 * Block '<S36>/ConstTrue' : Unused code path elimination
 * Block '<S36>/Constant' : Unused code path elimination
 * Block '<S36>/Constant1' : Unused code path elimination
 * Block '<S36>/Constant2' : Unused code path elimination
 * Block '<S36>/Constant3' : Unused code path elimination
 * Block '<S36>/Constant4' : Unused code path elimination
 * Block '<S36>/Constant5' : Unused code path elimination
 * Block '<S36>/Data Type Conversion' : Unused code path elimination
 * Block '<S38>/Abs' : Unused code path elimination
 * Block '<S38>/Abs1' : Unused code path elimination
 * Block '<S38>/Abs2' : Unused code path elimination
 * Block '<S38>/Abs3' : Unused code path elimination
 * Block '<S38>/Add' : Unused code path elimination
 * Block '<S38>/Add1' : Unused code path elimination
 * Block '<S38>/Constant2' : Unused code path elimination
 * Block '<S38>/Constant3' : Unused code path elimination
 * Block '<S38>/Constant4' : Unused code path elimination
 * Block '<S38>/Data Type Duplicate' : Unused code path elimination
 * Block '<S38>/Max1' : Unused code path elimination
 * Block '<S38>/Min1' : Unused code path elimination
 * Block '<S38>/Relational Operator' : Unused code path elimination
 * Block '<S38>/Relational Operator1' : Unused code path elimination
 * Block '<S38>/Switch' : Unused code path elimination
 * Block '<S38>/Switch1' : Unused code path elimination
 * Block '<S38>/Switch2' : Unused code path elimination
 * Block '<S38>/Switch3' : Unused code path elimination
 * Block '<S38>/Switch4' : Unused code path elimination
 * Block '<S38>/Unit Delay' : Unused code path elimination
 * Block '<S38>/Unit Delay1' : Unused code path elimination
 * Block '<S39>/Data Type Duplicate' : Unused code path elimination
 * Block '<S39>/Data Type Propagation' : Unused code path elimination
 * Block '<S39>/LowerRelop1' : Unused code path elimination
 * Block '<S39>/Switch' : Unused code path elimination
 * Block '<S39>/Switch2' : Unused code path elimination
 * Block '<S39>/UpperRelop' : Unused code path elimination
 * Block '<S37>/Constant' : Unused code path elimination
 * Block '<S37>/Data Type Conversion' : Unused code path elimination
 * Block '<S40>/Switch' : Unused code path elimination
 * Block '<S37>/VCULut1D' : Unused code path elimination
 * Block '<S1>/Data Type Conversion' : Eliminate redundant data type conversion
 * Block '<S1>/Data Type Conversion1' : Eliminate redundant data type conversion
 * Block '<S1>/Data Type Conversion2' : Eliminate redundant data type conversion
 * Block '<S31>/ConstFalse1' : Unused code path elimination
 * Block '<S31>/ConstTrue' : Unused code path elimination
 * Block '<S34>/Constant2' : Unused code path elimination
 */

/*-
 * The generated code includes comments that allow you to trace directly
 * back to the appropriate location in the model.  The basic format
 * is <system>/block_name, where system is the system number (uniquely
 * assigned by Simulink) and block_name is the name of the block.
 *
 * Use the MATLAB hilite_system command to trace the generated code back
 * to the model.  For example,
 *
 * hilite_system('<S3>')    - opens system 3
 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
 *
 * Here is the system hierarchy for this model
 *
 * '<Root>' : 'VCUComposition_demo'
 * '<S1>'   : 'VCUComposition_demo/Function-Call Subsystem3'
 * '<S2>'   : 'VCUComposition_demo/RapidECUSettingNew'
 * '<S3>'   : 'VCUComposition_demo/Subsystem Reference'
 * '<S4>'   : 'VCUComposition_demo/Subsystem Reference1'
 * '<S5>'   : 'VCUComposition_demo/VCUInHW'
 * '<S6>'   : 'VCUComposition_demo/VCUOutHW'
 * '<S7>'   : 'VCUComposition_demo/Function-Call Subsystem3/Chart'
 * '<S8>'   : 'VCUComposition_demo/Function-Call Subsystem3/EdgeRising'
 * '<S9>'   : 'VCUComposition_demo/Function-Call Subsystem3/GearFSM'
 * '<S10>'  : 'VCUComposition_demo/Function-Call Subsystem3/TurnOffDelayTime'
 * '<S11>'  : 'VCUComposition_demo/RapidECUSettingNew/BL'
 * '<S12>'  : 'VCUComposition_demo/RapidECUSettingNew/DAQ'
 * '<S13>'  : 'VCUComposition_demo/RapidECUSettingNew/EEPROM'
 * '<S14>'  : 'VCUComposition_demo/RapidECUSettingNew/Polling'
 * '<S15>'  : 'VCUComposition_demo/RapidECUSettingNew/BL/Function-Call Subsystem'
 * '<S16>'  : 'VCUComposition_demo/RapidECUSettingNew/BL/Function-Call Subsystem/Function-Call Subsystem'
 * '<S17>'  : 'VCUComposition_demo/RapidECUSettingNew/BL/Function-Call Subsystem/Function-Call Subsystem/Enabled Subsystem'
 * '<S18>'  : 'VCUComposition_demo/RapidECUSettingNew/BL/Function-Call Subsystem/Function-Call Subsystem/Enabled Subsystem/Com0'
 * '<S19>'  : 'VCUComposition_demo/RapidECUSettingNew/BL/Function-Call Subsystem/Function-Call Subsystem/Enabled Subsystem/Com1'
 * '<S20>'  : 'VCUComposition_demo/RapidECUSettingNew/BL/Function-Call Subsystem/Function-Call Subsystem/Enabled Subsystem/Com2'
 * '<S21>'  : 'VCUComposition_demo/RapidECUSettingNew/BL/Function-Call Subsystem/Function-Call Subsystem/Enabled Subsystem/If Action Subsystem'
 * '<S22>'  : 'VCUComposition_demo/RapidECUSettingNew/BL/Function-Call Subsystem/Function-Call Subsystem/Enabled Subsystem/If Action Subsystem1'
 * '<S23>'  : 'VCUComposition_demo/RapidECUSettingNew/DAQ/daq100ms'
 * '<S24>'  : 'VCUComposition_demo/RapidECUSettingNew/DAQ/daq10ms'
 * '<S25>'  : 'VCUComposition_demo/RapidECUSettingNew/DAQ/daq50ms'
 * '<S26>'  : 'VCUComposition_demo/RapidECUSettingNew/DAQ/daq5ms'
 * '<S27>'  : 'VCUComposition_demo/RapidECUSettingNew/EEPROM/EEPROMOperation'
 * '<S28>'  : 'VCUComposition_demo/RapidECUSettingNew/Polling/CCPBackground'
 * '<S29>'  : 'VCUComposition_demo/RapidECUSettingNew/Polling/CCPReceive'
 * '<S30>'  : 'VCUComposition_demo/RapidECUSettingNew/Polling/CCPReceive/Nothing'
 * '<S31>'  : 'VCUComposition_demo/Subsystem Reference/HwErrAbcr'
 * '<S32>'  : 'VCUComposition_demo/Subsystem Reference/SigExc'
 * '<S33>'  : 'VCUComposition_demo/Subsystem Reference/HwErrAbcr/Interval Test Dynamic'
 * '<S34>'  : 'VCUComposition_demo/Subsystem Reference/HwErrAbcr/JumpDebouncer'
 * '<S35>'  : 'VCUComposition_demo/Subsystem Reference/SigExc/If_Then_else'
 * '<S36>'  : 'VCUComposition_demo/Subsystem Reference1/Subsystem'
 * '<S37>'  : 'VCUComposition_demo/Subsystem Reference1/Subsystem1'
 * '<S38>'  : 'VCUComposition_demo/Subsystem Reference1/Subsystem/JumpDebouncer'
 * '<S39>'  : 'VCUComposition_demo/Subsystem Reference1/Subsystem/Saturation Dynamic'
 * '<S40>'  : 'VCUComposition_demo/Subsystem Reference1/Subsystem1/If_Then_else'
 * '<S41>'  : 'VCUComposition_demo/VCUOutHW/If_Then_else'
 */
#endif                                 /* RTW_HEADER_VCUComposition_demo_h_ */

/* File trailer for ECUCoder generated file VCUComposition_demo.h.
 *
 * [EOF]
 */
